<template>
  <div class="app-container home">
    <defaultPage v-if="appCode === 'defaultPage'"></defaultPage>
    <messageCenter v-if="appCode === 'messageCenter'"></messageCenter>
    <systemMonitor v-if="appCode === 'systemMonitor'"></systemMonitor>
    <systemTool v-if="appCode === 'systemTool'"></systemTool>
  </div>
</template>

<script>
import defaultPage from '@/views/indexpage/default/index.vue'
import messageCenter from '@/views/indexpage/messageCenter/index.vue'
import systemMonitor from '@/views/indexpage/systemMonitor/index.vue'
import systemTool from '@/views/indexpage/systemTool/index.vue'
export default {
  name: "Index",
  components: {
    defaultPage, messageCenter, systemMonitor, systemTool
  },
  data() {
    return {
      appCode: ''
    };
  },
  watch: {
    $route: {
      handler: function (route) {
        //获取当前应用编码
        var appCodeS = sessionStorage.getItem("INTELLIGENT_PLANTFORM_SYSTEM_APP_CODE")
        switch(appCodeS) {
           case "systemConfig":
              this.appCode = "defaultPage"
              break;
           case "messageCenter":
              this.appCode = "messageCenter"
              break;
           case "systemMonitor":
              this.appCode = "systemMonitor"
              break;
           case "systemTool":
              this.appCode = "systemTool"
              break;
           default:
              this.appCode = "defaultPage"
        }
      },
      immediate: true
    }
  },
  methods: {

  }
};
</script>

<style scoped lang="scss">

</style>

